{% extends 'base.html' %}

{% block header_text %}Your To-Do list{% endblock %}

{% block form_action %}{% url 'view_list' list.id %}{% endblock %}

{% block table %}
	<table id="id_list_table" class="table">
		{% for item in list.item_set.all %}
			<tr><td>{{ forloop.counter }}: {{ item.text }}</td></tr>
		{% endfor %}
	</table>
{% endblock %}

{% block extra_content %}
  <div class="row">

    <div class="col-md-6">
      <h3>Shared with</h3>
      <ul>
        {% for sharee in list.shared_with.all %}
          <li class="list-sharee">{{ sharee.email }}</li>
        {% endfor %}
      </ul>
    </div>

    <div class="col-md-3">
      <h3>Share this list:</h3>
      <form class="form-inline" method="POST" action="{% url 'share_list' list.id %}" >
        {% csrf_token %}
        <input name="sharee" placeholder="your-friend@example.com" />
      </form>
    </div>
  </div>
{% endblock %}